package com.mlog.njyjy.ndop.share.zabbix.client;

import com.mlog.njyjy.ndop.share.zabbix.ex.ZabbixClientException;
import com.mlog.njyjy.ndop.share.zabbix.request.core.ZabbixRequest;
import com.mlog.njyjy.ndop.share.zabbix.response.ZabbixResponse;

/**
 * <p>
 * .
 * </p>
 *
 * @author <a href="mailto:yingxiufeng@mlogcn.com">alex</a>
 * @version v1.0, 2020/6/29
 */
public interface ZabbixClient extends AutoCloseable {


    /**
     * execute
     * @param request
     * @param <T>
     * @return
     * @throws ZabbixClientException
     */
   <T extends ZabbixResponse> T execute(ZabbixRequest<T> request) throws ZabbixClientException;

    /**
     * execute async
     * @param request
     * @param responseHandler
     * @param <T>
     * @return
     */
   <T extends ZabbixResponse> void executeAsync(ZabbixRequest<T> request, ZabbixResponseHandler<? super T> responseHandler);

    /**
     * api version
     * @return
     */
    String apiVersion();
}
